fix(server): dedupe remote collection requests - #535
Conversation
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe server bundle now caches the in-flight promise for each remote collection. Concurrent calls share one fetch. Rejected fetches and JSON parsing failures clear the cache and allow retries. Falsy collection results are not retained. New tests load the generated server bundle and verify concurrent deduplication, successful caching, failure retries, and retries after falsy responses. Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Remote icon collections now share concurrent downloads while retaining caching and retry behavior after failed or falsy responses. The covered behavior is ready to merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔗 Linked issue
Resolves #534.
📚 Description
Concurrent requests for different icons in a cold remote collection each download the whole collection. This caches the pending fetch so callers share it, and clears failed fetches or JSON parses so later requests can retry.
With 20 overlapping requests for one 49,940-byte collection, the production Node repro goes from 20 downloads / 998,800 bytes to 1 / 49,940 bytes. Sharing is per process and applies to remote server bundles.
Repro: Before · After, with a pnpm patch. Runs locally against a production Node build.